<?
$pos=strpos($siteInfo['header_code'],'{[login]}');
if ($pos===false) {
    $siteInfo['header_code']=htmlspecialchars_decode($siteInfo['header_code']);
} else {
	if ($_SESSION['union_username'] =='') {
       
	    $replace_string="<form method=\"post\" id=\"form1\" action=\"https://passport.9wee.com/login\" onsubmit='javascript: return checklogininfo();'>
					<ul>
						<li>会员登录:</li>
						<li>用户名:</li>
						<li><input type=\"text\" class=\"header_input\" name=\"username\"  style=\"width:106px; height:14px;\" /></li>
						<li>密 码:<input id='_REFERER' type='hidden' name='_REFERER' value='http://".$_SERVER['HTTP_HOST']."/list.php'></li>
						<li><input type=\"password\" class=\"header_input\" name=\"password\" style=\"width:106px; height:14px;\" /></li>
						<li class=\"c\"><input type=\"image\" src=\"../images/9wee_login.gif\"></li>
						<li><a href=\"../register.php\">用户注册</a>|<a href=\"https://passport.9wee.com/getpsw?from=gameunion\" target='_blank'>忘记密码</a></li>
					</ul></form>";
	} else {
	    $replace_string="<div align=\"right\">欢迎您回来，".$_SESSION['union_username']."&nbsp;&nbsp;&nbsp;<a href=\"../logout.php?url=http://".$_SERVER['HTTP_HOST']."\">注销</a></div>";	
	}
    $replace_string="<div class=\"header_login\">".$replace_string."</div>";
	$siteInfo['header_code']=str_replace('{[login]}',$replace_string,$siteInfo['header_code']);
}
?>